package com.demo.bookstore.model;

import java.io.Serializable;
import java.util.Date;

public class BookEntity implements Serializable {
    private Integer id;

    private String name;

    private String classification;

    private String description;

    private Date publishDate;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public BookEntity withId(Integer id) {
        this.setId(id);
        return this;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public BookEntity withName(String name) {
        this.setName(name);
        return this;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getClassification() {
        return classification;
    }

    public BookEntity withClassification(String classification) {
        this.setClassification(classification);
        return this;
    }

    public void setClassification(String classification) {
        this.classification = classification == null ? null : classification.trim();
    }

    public String getDescription() {
        return description;
    }

    public BookEntity withDescription(String description) {
        this.setDescription(description);
        return this;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public BookEntity withPublishDate(Date publishDate) {
        this.setPublishDate(publishDate);
        return this;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", classification=").append(classification);
        sb.append(", description=").append(description);
        sb.append(", publishDate=").append(publishDate);
        sb.append("]");
        return sb.toString();
    }
}